import {url,axios} from '.';

export const find = async (params) => {
    let res = await axios({
        method:"get",
        url: url + "/students",
        params
    });
    return res.data;
}
export const findById = async (id) => {
    let res = await axios({
        method:"get",
        url: url + "/students/" + id
    });
    return res.data;
}
export const insert = async (data) => {
    let res = await axios({
        method:"post",
        url:url + "/students",
        data
    });
    return res.data;
}
export const update = async (data) => {
    let res = await axios({
        method:"put",
        url:url + "/students/" + data._id,
        data
    });
    return res.data;
}
export const remove = async (id) => {
    let res = await axios({
        method:"delete",
        url:url + "/students/" + id
    });
    return res.data;
}